home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / game / board / gchess4d.lha / gnuchess-4.0.pl74.patch < prev   
Text File  |  1995-05-03  |  23KB  |  848 lines

  1. Only in gnuchess-4.0.pl74/src: Install
  2. Only in gnuchess-4.0.pl74/src: Install.info
  3. Only in gnuchess-4.0.pl74/src: Makefile.amiga
  4. diff -r -b -c gnuchess-4.0.pl74.orig/src/binsort.c gnuchess-4.0.pl74/src/binsort.c
  5. *** gnuchess-4.0.pl74.orig/src/binsort.c    Mon Sep 19 10:23:04 1994
  6. --- gnuchess-4.0.pl74/src/binsort.c    Wed May 03 00:32:34 1995
  7. ***************
  8. *** 82,89 ****
  9. --- 82,94 ----
  10.   #    include <sys/types.h>        /* for statistics & io */
  11.   #    include <sys/stat.h>         /* for i/o */
  12.   #    include <errno.h>
  13. + #ifndef _amigados
  14.   #    include <sys/param.h>        /* for statistics */
  15.   #    include <sys/times.h>        /* for statistics */
  16. + #else
  17. + #define NOUNISTD
  18. + #define FUNCPROTO
  19. + #endif
  20.   #    include <time.h>
  21.   #    include <stdlib.h>
  22.   
  23. ***************
  24. *** 1171,1177 ****
  25. --- 1176,1184 ----
  26.   prtstatist(realtime)
  27.   long            realtime;
  28.   {
  29. + #ifndef _amigados
  30.     struct tms    spenttime;
  31. + #endif
  32.     int           tapenum;
  33.     unsigned long one, total;
  34.   
  35. ***************
  36. *** 1188,1198 ****
  37. --- 1195,1207 ----
  38.       }
  39.     fprintf(stderr,"\t\tTotal  : %10ld\n", total);
  40.     fprintf(stderr,"\tReal time [s]:\t\t\t%d\n", (int)realtime + 1);
  41. + #ifndef _amigados
  42.     times(&spenttime);
  43.     fprintf(stderr,"\tUser time [s]:\t\t\t%.2f\n",
  44.         (float)spenttime.tms_utime/(float)CLOCKFREQ);
  45.     fprintf(stderr,"\tSystem time [s]:\t\t%.2f\n",
  46.         (float)spenttime.tms_stime/(float)CLOCKFREQ);
  47. + #endif
  48.   }
  49.   
  50.   
  51. ***************
  52. *** 1500,1506 ****
  53. --- 1509,1519 ----
  54.     struct stat statstr;
  55.   
  56.     ctape = TAPE + num;
  57. + #ifndef _amigados
  58.     sprintf(scrname, "%s/binsort%07d%d", scrpath, getpid(), num); /* gen name */
  59. + #else
  60. +   sprintf(scrname, "%s/binsort%s", scrpath, tmpnam(NULL));
  61. + #endif
  62.     if ((fdes = open(scrname, O_RDWR | O_CREAT, S_IREAD|S_IWRITE)) < 0)
  63.                   /* create scratch file */
  64.       ioerr();
  65. diff -r -b -c gnuchess-4.0.pl74.orig/src/book.c gnuchess-4.0.pl74/src/book.c
  66. *** gnuchess-4.0.pl74.orig/src/book.c    Wed Feb 22 00:46:32 1995
  67. --- gnuchess-4.0.pl74/src/book.c    Wed May 03 00:32:36 1995
  68. ***************
  69. *** 23,29 ****
  70.   #include "gnuchess.h"
  71.   #include "ttable.h"        /* uses hashbd, hashkey */
  72.   #include "ataks.h"
  73. ! #if !defined(AMIGADOS) && !defined(Think_C)
  74.   #include <unistd.h>
  75.   #endif
  76.   #ifdef Think_C
  77. --- 23,29 ----
  78.   #include "gnuchess.h"
  79.   #include "ttable.h"             /* uses hashbd, hashkey */
  80.   #include "ataks.h"
  81. ! #if !defined(_amigados) && !defined(Think_C)
  82.   #include <unistd.h>
  83.   #endif
  84.   #ifdef Think_C
  85. Only in gnuchess-4.0.pl74/src: doc
  86. diff -r -b -c gnuchess-4.0.pl74.orig/src/dspcom.c gnuchess-4.0.pl74/src/dspcom.c
  87. *** gnuchess-4.0.pl74.orig/src/dspcom.c    Sat Feb 11 04:04:13 1995
  88. --- gnuchess-4.0.pl74/src/dspcom.c    Wed May 03 00:32:38 1995
  89. ***************
  90. *** 59,65 ****
  91.   #include <sys/param.h>
  92.   #include <sys/types.h>
  93.   #include <sys/file.h>
  94. ! #ifndef AMIGADOS
  95.   #include <sys/ioctl.h>
  96.   #endif
  97.   #endif /* Think_C */
  98. --- 59,72 ----
  99.   #include <sys/param.h>
  100.   #include <sys/types.h>
  101.   #include <sys/file.h>
  102. ! #if defined(_amigados)
  103. ! /*
  104. !     We cannot use the Amiga headers, as exec/types.h would redefine
  105. !     the SHORT type. Fortunately we do not need very much of them:
  106. ! */
  107. ! #define SIGBREAKF_SET 0xf000 /* SIGBREAKF_CTRL(C|D|E|F) */
  108. ! extern long SetSignal(long, long);
  109. ! #else
  110.   #include <sys/ioctl.h>
  111.   #endif
  112.   #endif /* Think_C */
  113. ***************
  114. *** 1429,1435 ****
  115.   
  116.   {
  117.   struct timeval tv;
  118. ! #ifndef MSDOS
  119.     int nchar;
  120.     extern int errno;
  121.     int i;
  122. --- 1436,1442 ----
  123.   
  124.   {
  125.   struct timeval tv;
  126. ! #if !defined(MSDOS)  &&  !defined(_amigados)
  127.     int nchar;
  128.     extern int errno;
  129.     int i;
  130. ***************
  131. *** 1451,1463 ****
  132.       }
  133.   #endif /*FIONREAD*/
  134.   #else
  135.     if (kbhit ())
  136.       {
  137.         if (!flag.timeout)
  138.       flag.back = true;
  139.         flag.bothsides = false;
  140.       }
  141. ! #endif /* MSDOS */
  142.     gettimeofday(&tv,NULL);
  143.     et = (tv.tv_sec*100+(tv.tv_usec/10000)) - time0;
  144.     ETnodes = NodeCnt + ZNODES;
  145. --- 1458,1482 ----
  146.       }
  147.   #endif /*FIONREAD*/
  148.   #else
  149. + /*
  150. +     On the Amiga we have two possibilities of interrupting GNU Chess:
  151. +     Breaking with Ctrl-C is less comfortable for the user, but
  152. +     checking for it is faster.
  153. +     We choose the comfortable way for curses and the fast way for
  154. +     AmyBoard.
  155. + */
  156. + #if defined(_amigados) && defined(XBOARD)
  157. +   if (SetSignal(0, SIGBREAKF_SET) & SIGBREAKF_SET)
  158. + #else
  159.     if (kbhit ())
  160. + #endif
  161.       {
  162.         if (!flag.timeout)
  163.           flag.back = true;
  164.         flag.bothsides = false;
  165.       }
  166. ! #endif /* MSDOS  ||  _amigados  */
  167.     gettimeofday(&tv,NULL);
  168.     et = (tv.tv_sec*100+(tv.tv_usec/10000)) - time0;
  169.     ETnodes = NodeCnt + ZNODES;
  170. ***************
  171. *** 1495,1501 ****
  172.    */
  173.   
  174.   {
  175. ! #ifndef MSDOS
  176.     int nchar;
  177.     extern int errno;
  178.     int i;
  179. --- 1514,1520 ----
  180.    */
  181.   
  182.   {
  183. ! #if !defined(MSDOS)  &&  !defined(_amigados)
  184.     int nchar;
  185.     extern int errno;
  186.     int i;
  187. ***************
  188. *** 1523,1529 ****
  189.       flag.back = true;
  190.         flag.bothsides = false;
  191.       }
  192. ! #endif /* MSDOS */
  193.     et = (time ((time_t *) 0) - time0) * 100;
  194.     ETnodes = NodeCnt + ZNODES;
  195.     if (et < 0)
  196. --- 1542,1548 ----
  197.           flag.back = true;
  198.         flag.bothsides = false;
  199.       }
  200. ! #endif /* MSDOS  ||  _amigados */
  201.     et = (time ((time_t *) 0) - time0) * 100;
  202.     ETnodes = NodeCnt + ZNODES;
  203.     if (et < 0)
  204. diff -r -b -c gnuchess-4.0.pl74.orig/src/eco.c gnuchess-4.0.pl74/src/eco.c
  205. *** gnuchess-4.0.pl74.orig/src/eco.c    Mon Sep 19 10:23:05 1994
  206. --- gnuchess-4.0.pl74/src/eco.c    Wed May 03 00:32:38 1995
  207. ***************
  208. *** 23,29 ****
  209.   #include "gnuchess.h"
  210.   #include "ttable.h" /* uses hashbd, hashkey */
  211.   #include "ataks.h"
  212. ! #if !defined(AMIGADOS) && !defined(Think_C)
  213.   #include <unistd.h>
  214.   #endif
  215.   #ifdef Think_C
  216. --- 23,29 ----
  217.   #include "gnuchess.h"
  218.   #include "ttable.h" /* uses hashbd, hashkey */
  219.   #include "ataks.h"
  220. ! #if !defined(_amigados) && !defined(Think_C)
  221.   #include <unistd.h>
  222.   #endif
  223.   #ifdef Think_C
  224. diff -r -b -c gnuchess-4.0.pl74.orig/src/ecocvt.c gnuchess-4.0.pl74/src/ecocvt.c
  225. *** gnuchess-4.0.pl74.orig/src/ecocvt.c    Tue Sep 20 03:09:34 1994
  226. --- gnuchess-4.0.pl74/src/ecocvt.c    Wed May 03 00:32:38 1995
  227. ***************
  228. *** 1,5 ****
  229. --- 1,8 ----
  230.   #include <fcntl.h>
  231.   #include <sys/types.h>
  232. + #if defined(_amigados)
  233. + #define LIBRARIES_DOS_H
  234. + #endif
  235.   #include <sys/stat.h>
  236.   #include "gnuchess.h"
  237.   struct gdxdata
  238. diff -r -b -c gnuchess-4.0.pl74.orig/src/ecosort.c gnuchess-4.0.pl74/src/ecosort.c
  239. *** gnuchess-4.0.pl74.orig/src/ecosort.c    Mon Sep 19 10:23:05 1994
  240. --- gnuchess-4.0.pl74/src/ecosort.c    Wed May 03 00:32:38 1995
  241. ***************
  242. *** 7,12 ****
  243. --- 7,13 ----
  244.         utshort cntr;
  245.         };
  246.   char strcmd[256];
  247. + #ifndef _amigados
  248.   main()
  249.   {
  250.   sprintf(strcmd,"./binsort -r %d -k L:a:0:2</tmp/step1.eco>/tmp/step2.eco\n",sizeof(struct gdxecodata));
  251. ***************
  252. *** 14,16 ****
  253. --- 15,31 ----
  254.   system(strcmd);
  255.   exit(0);
  256.   }
  257. + #else
  258. + int main(int argc, char *argv[])
  259. + {
  260. +     if (argc < 4) {
  261. +     fprintf(stderr, "Usage: ecosort <binsortpath> <step1path> <step2path>");
  262. +     exit(10);
  263. +     }
  264. +     sprintf(strcmd, "%s -r %d -k L:a:0:2 <%s >%s\n",
  265. +         argv[1], sizeof(struct gdxecodata), argv[2], argv[3]);
  266. +     system(strcmd);
  267. +     exit(0);
  268. + }
  269. + #endif
  270. diff -r -b -c gnuchess-4.0.pl74.orig/src/eval.c gnuchess-4.0.pl74/src/eval.c
  271. *** gnuchess-4.0.pl74.orig/src/eval.c    Fri Feb 10 21:54:43 1995
  272. --- gnuchess-4.0.pl74/src/eval.c    Wed May 03 00:32:38 1995
  273. ***************
  274. *** 1574,1580 ****
  275.                   pp = false;
  276.                   break;
  277.                   }
  278. !               z = (pp ? i - ((row (i) == 6) ? 8 : 16) : i);
  279.                 Pd += ((pp) ? 5 * taxicab (sq, z) : taxicab (sq, z));
  280.             }
  281.           }
  282. --- 1574,1580 ----
  283.                   pp = false;
  284.                   break;
  285.                   }
  286. !               z = (pp ? i - ((row (i) == 1) ? 8 : 16) : i);
  287.                 Pd += ((pp) ? 5 * taxicab (sq, z) : taxicab (sq, z));
  288.             }
  289.           }
  290. Only in gnuchess-4.0.pl74/src: gettimeofday.c
  291. diff -r -b -c gnuchess-4.0.pl74.orig/src/gnuan.c gnuchess-4.0.pl74/src/gnuan.c
  292. *** gnuchess-4.0.pl74.orig/src/gnuan.c    Mon Sep 19 10:23:06 1994
  293. --- gnuchess-4.0.pl74/src/gnuan.c    Wed May 03 00:32:40 1995
  294. ***************
  295. *** 77,83 ****
  296.   #include <sys/param.h>
  297.   #include <sys/types.h>
  298.   #include <sys/file.h>
  299. ! #ifndef AMIGADOS
  300.   #include <sys/ioctl.h>
  301.   #endif
  302.   void TerminateSearch (int), Die (int);
  303. --- 77,83 ----
  304.   #include <sys/param.h>
  305.   #include <sys/types.h>
  306.   #include <sys/file.h>
  307. ! #ifndef _amigados
  308.   #include <sys/ioctl.h>
  309.   #endif
  310.   void TerminateSearch (int), Die (int);
  311. ***************
  312. *** 622,628 ****
  313.   {
  314.       struct timeval tv;
  315.   
  316. ! #ifndef MSDOS
  317.       int nchar;
  318.       extern int errno;
  319.       int i;
  320. --- 622,628 ----
  321.   {
  322.       struct timeval tv;
  323.   
  324. ! #if !defined(MSDOS)  &&  !defined(_amigados)
  325.       int nchar;
  326.       extern int errno;
  327.       int i;
  328. ***************
  329. *** 650,656 ****
  330.             flag.back = true;
  331.         flag.bothsides = false;
  332.         }
  333. ! #endif /* MSDOS */
  334.       gettimeofday (&tv, NULL);
  335.       et = (tv.tv_sec * 100 + (tv.tv_usec / 10000)) - time0;
  336.       ETnodes = NodeCnt + ZNODES;
  337. --- 650,656 ----
  338.                 flag.back = true;
  339.             flag.bothsides = false;
  340.         }
  341. ! #endif /* MSDOS  ||  _amigados  */
  342.       gettimeofday (&tv, NULL);
  343.       et = (tv.tv_sec * 100 + (tv.tv_usec / 10000)) - time0;
  344.       ETnodes = NodeCnt + ZNODES;
  345. ***************
  346. *** 679,685 ****
  347.    */
  348.   
  349.   {
  350. ! #ifndef MSDOS
  351.       int nchar;
  352.       extern int errno;
  353.       int i;
  354. --- 679,685 ----
  355.    */
  356.   
  357.   {
  358. ! #if !defined(MSDOS)  &&  !defined(_amigados)
  359.       int nchar;
  360.       extern int errno;
  361.       int i;
  362. ***************
  363. *** 707,713 ****
  364.             flag.back = true;
  365.         flag.bothsides = false;
  366.         }
  367. ! #endif /* MSDOS */
  368.       et = (time ((long *) 0) - time0) * 100;
  369.       ETnodes = NodeCnt + ZNODES;
  370.       if (et < 0)
  371. --- 707,713 ----
  372.                 flag.back = true;
  373.             flag.bothsides = false;
  374.         }
  375. ! #endif /* MSDOS  ||  _amigados */
  376.       et = (time ((long *) 0) - time0) * 100;
  377.       ETnodes = NodeCnt + ZNODES;
  378.       if (et < 0)
  379. diff -r -b -c gnuchess-4.0.pl74.orig/src/gnuchess.h gnuchess-4.0.pl74/src/gnuchess.h
  380. *** gnuchess-4.0.pl74.orig/src/gnuchess.h    Sat Feb 04 22:05:34 1995
  381. --- gnuchess-4.0.pl74/src/gnuchess.h    Wed May 03 00:32:40 1995
  382. ***************
  383. *** 32,38 ****
  384.   #define huge
  385.   #endif
  386.   #include <stdio.h>
  387. ! #if !defined(NOMEMSET) 
  388.   #include <memory.h>
  389.   #endif
  390.   #ifdef SIGNCHAR
  391. --- 32,38 ----
  392.   #define huge
  393.   #endif
  394.   #include <stdio.h>
  395. ! #if !defined(NOMEMSET)  &&  !defined(_amigados)
  396.   #include <memory.h>
  397.   #endif
  398.   #ifdef SIGNCHAR
  399. ***************
  400. *** 81,87 ****
  401.   #ifndef Think_C
  402.   #include <sys/param.h>
  403.   #include <sys/types.h>
  404. ! #ifndef AMIGADOS
  405.   #include <sys/times.h>
  406.   #endif
  407.   #endif /* Think_C */
  408. --- 81,87 ----
  409.   #ifndef Think_C
  410.   #include <sys/param.h>
  411.   #include <sys/types.h>
  412. ! #ifndef _amigados
  413.   #include <sys/times.h>
  414.   #endif
  415.   #endif /* Think_C */
  416. ***************
  417. *** 89,94 ****
  418. --- 89,102 ----
  419.   #define printz printf
  420.   #define scanz scanf
  421.   #else
  422. + #ifdef _amigados
  423. + #define EXEC_TYPES_H            /*  Prevent exec/types.h from being  */
  424. + typedef unsigned char UBYTE;    /*  included as this would redefine  */
  425. + typedef short WORD;             /*  SHORT. Some typedef's required   */
  426. + typedef unsigned short UWORD;   /*  by curses.h, however.            */
  427. + typedef long LONG;
  428. + typedef unsigned long ULONG;
  429. + #endif
  430.   #include <curses.h>
  431.   #define scanz fflush(stdout),scanw
  432.   #define printz printw
  433. ***************
  434. *** 238,245 ****
  435.   #define QBLOCK false        /* if true cache quiescent positions */
  436.   #define BESTDELTA 90
  437.   /* about 1/2 second worth of nodes for your machine */
  438. ! #ifdef Think_C
  439.   #define ZNODES 500              /* check the time every ZNODES positions */
  440.   #else /* Think_C */
  441.   #define ZNODES 4000             /* check the time every ZNODES positions */
  442.   #endif /* Think_C */
  443. --- 246,255 ----
  444.   #define QBLOCK false            /* if true cache quiescent positions */
  445.   #define BESTDELTA 90
  446.   /* about 1/2 second worth of nodes for your machine */
  447. ! #if defined(Think_C)
  448.   #define ZNODES 500              /* check the time every ZNODES positions */
  449. + #elif defined(_amigados)
  450. + #define ZNODES 1000             /* check the time every ZNODES positions */
  451.   #else /* Think_C */
  452.   #define ZNODES 4000             /* check the time every ZNODES positions */
  453.   #endif /* Think_C */
  454. ***************
  455. *** 430,436 ****
  456.        extern unsigned int starttime;
  457.        extern SHORT distdata[64][64], taxidata[64][64];
  458.        extern CHAR mvstr[5][7];
  459. ! #ifndef AMIGADOS
  460.        extern union U admin;
  461.   #endif
  462.        extern UTSHORT bookmaxply;
  463. --- 440,446 ----
  464.        extern unsigned int starttime;
  465.        extern SHORT distdata[64][64], taxidata[64][64];
  466.        extern CHAR mvstr[5][7];
  467. ! #ifndef _amigados
  468.        extern union U admin;
  469.   #endif
  470.        extern UTSHORT bookmaxply;
  471. ***************
  472. *** 554,566 ****
  473.        extern int pick (SHORT p1, SHORT p2);
  474.        extern int VerifyMove (CHAR *s, SHORT inp, UTSHORT *mv);
  475.        extern void VMoveList (SHORT side, register SHORT ply);
  476. ! #if !defined(AMIGADOS)
  477.        extern struct gdxadmin B;
  478.   #endif
  479.   
  480. - #if defined(AMIGADOS)  &&  !defined(XBOARD)
  481. - #define exit(retcode) CleanExit(retcode)
  482. - #endif
  483.   /* Take care of NOMEMSET once and for all... */
  484.   #if (defined(NOMEMSET) || defined(MSDOS)) && !defined(__GNUC__)
  485.   #define memset(s,c,l) {\
  486. --- 564,573 ----
  487.        extern int pick (SHORT p1, SHORT p2);
  488.        extern int VerifyMove (CHAR *s, SHORT inp, UTSHORT *mv);
  489.        extern void VMoveList (SHORT side, register SHORT ply);
  490. ! #if !defined(_amigados)
  491.        extern struct gdxadmin B;
  492.   #endif
  493.   
  494.   /* Take care of NOMEMSET once and for all... */
  495.   #if (defined(NOMEMSET) || defined(MSDOS)) && !defined(__GNUC__)
  496.   #define memset(s,c,l) {\
  497. Only in gnuchess-4.0.pl74/src: kbhit.c
  498. diff -r -b -c gnuchess-4.0.pl74.orig/src/nondsp.c gnuchess-4.0.pl74/src/nondsp.c
  499. *** gnuchess-4.0.pl74.orig/src/nondsp.c    Fri Feb 10 21:51:25 1995
  500. --- gnuchess-4.0.pl74/src/nondsp.c    Wed May 03 00:32:40 1995
  501. ***************
  502. *** 29,35 ****
  503.   /*#include <conio.h>*/
  504.   #elif !defined(Think_C)
  505.   #include <sys/file.h>
  506. ! #ifndef AMIGADOS
  507.   #include <sys/ioctl.h>
  508.   #endif
  509.   
  510. --- 29,35 ----
  511.   /*#include <conio.h>*/
  512.   #elif !defined(Think_C)
  513.   #include <sys/file.h>
  514. ! #ifndef _amigados
  515.   #include <sys/ioctl.h>
  516.   #endif
  517.   
  518. ***************
  519. *** 62,68 ****
  520.   {
  521.     mycnt1 = mycnt2 = 0;
  522.   #if defined CHESSTOOL || defined XBOARD
  523. ! #if defined(SYSV)  ||  defined(AMIGADOS)
  524.     setvbuf (stdout, NULL, _IOLBF, BUFSIZ);
  525.   #else
  526.     setlinebuf (stdout);
  527. --- 62,68 ----
  528.   {
  529.     mycnt1 = mycnt2 = 0;
  530.   #if defined CHESSTOOL || defined XBOARD
  531. ! #if defined(SYSV)  ||  defined(_amigados)
  532.     setvbuf (stdout, NULL, _IOLBF, BUFSIZ);
  533.   #else
  534.     setlinebuf (stdout);
  535. diff -r -b -c gnuchess-4.0.pl74.orig/src/nuxdsp.c gnuchess-4.0.pl74/src/nuxdsp.c
  536. *** gnuchess-4.0.pl74.orig/src/nuxdsp.c    Tue Nov 22 01:36:43 1994
  537. --- gnuchess-4.0.pl74/src/nuxdsp.c    Wed May 03 00:32:40 1995
  538. ***************
  539. *** 37,43 ****
  540. --- 37,45 ----
  541.   #include <sys/param.h>
  542.   #include <sys/types.h>
  543.   #include <sys/file.h>
  544. + #ifndef _amigados
  545.   #include <curses.h>
  546. + #endif
  547.   
  548.   #ifdef notdef
  549.   #if defined(__STDC__)
  550. ***************
  551. *** 104,109 ****
  552. --- 106,116 ----
  553.     signal (SIGINT, Die);
  554.   #ifndef MSDOS
  555.     signal (SIGQUIT, Die);
  556. + #ifdef _amigados
  557. +   if (atexit((void (*)(void)) endwin))
  558. +   { perror("atexit");
  559. +   }
  560. + #endif
  561.     initscr ();
  562.     crmode ();
  563.   #else
  564. diff -r -b -c gnuchess-4.0.pl74.orig/src/search.c gnuchess-4.0.pl74/src/search.c
  565. *** gnuchess-4.0.pl74.orig/src/search.c    Wed Feb 22 00:46:50 1995
  566. --- gnuchess-4.0.pl74/src/search.c    Wed May 03 00:32:42 1995
  567. ***************
  568. *** 269,275 ****
  569.             /* calculate avg time per move remaining */
  570.   
  571.             ResponseTime = TimeControl.clock[side] / TimeControl.moves[side];
  572. !           ResponseTime += TCadd * 3 / 4;
  573.             TCleft = (int) ResponseTime / 5;
  574.             if (TimeControl.moves[side] < 5)
  575.           TCcount = MAXTCCOUNTX - 10;
  576. --- 269,276 ----
  577.             /* calculate avg time per move remaining */
  578.   
  579.             ResponseTime = TimeControl.clock[side] / TimeControl.moves[side];
  580. !           ResponseTime = ResponseTime * 2 / 3;
  581. !           ResponseTime += TCadd / 2;
  582.             TCleft = (int) ResponseTime / 5;
  583.             if (TimeControl.moves[side] < 5)
  584.           TCcount = MAXTCCOUNTX - 10;
  585. ***************
  586. *** 1245,1251 ****
  587.   #endif
  588.             ElapsedTime (2);
  589.             TCcount++;
  590. -           if (et > ResponseTime) flag.timeout = true;
  591.             if (!background && Sdepth > 2)
  592.           {
  593.             if (best < alpha)
  594. --- 1246,1251 ----
  595. diff -r -b -c gnuchess-4.0.pl74.orig/src/ttable.c gnuchess-4.0.pl74/src/ttable.c
  596. *** gnuchess-4.0.pl74.orig/src/ttable.c    Sun Feb 05 06:47:31 1995
  597. --- gnuchess-4.0.pl74/src/ttable.c    Wed May 03 00:32:42 1995
  598. ***************
  599. *** 21,27 ****
  600.   struct hashentry *ttable[2];
  601.   
  602.   unsigned long ttblsize;
  603. ! /* unsigned */ SHORT rehash;  /* -1 is used as a flag --tpm */
  604.   #ifdef NEWAGE
  605.           utshort TTage;        /* Current ttable age */
  606.           UTSHORT TTageClock,    /* Count till next age tick */
  607. --- 21,27 ----
  608.   struct hashentry *ttable[2];
  609.   
  610.   unsigned long ttblsize;
  611. ! SHORT rehash;  /* -1 is used as a flag --tpm */
  612.   #ifdef NEWAGE
  613.           utshort TTage;        /* Current ttable age */
  614.           UTSHORT TTageClock,    /* Count till next age tick */
  615. ***************
  616. *** 99,105 ****
  617.   
  618.   {
  619.     register struct hashentry *ptbl;
  620. !   register /*unsigned*/ SHORT i = 0;    /*to match new type of rehash --tpm*/
  621.   
  622.   #ifdef DEBUG
  623.       if(flag.nott)return false;
  624. --- 99,105 ----
  625.   
  626.   {
  627.       register struct hashentry *ptbl;
  628. !     register SHORT i = 0;
  629.   
  630.   #ifdef DEBUG
  631.       if(flag.nott)return false;
  632. ***************
  633. *** 107,112 ****
  634. --- 107,120 ----
  635.   #ifdef HASHSTATS
  636.       ttprobe[depth]++;
  637.   #endif
  638. + #ifdef NEWAGE
  639. +       /* Find entry within rehash window or return failure */
  640. +       for (i=rehash, ptbl = &ttable[side][hashkey % ttblsize];
  641. +            ptbl->hashbd != hashbd; ptbl++)
  642. +         if (--i == 0) return false;
  643. +       /* Update age of rediscovered node */
  644. +           ptbl->age = TTage - TTdepthage[ptbl->depth];
  645. + #else
  646.       ptbl = &ttable[side][hashkey % ttblsize];
  647.       while (true)
  648.         {
  649. ***************
  650. *** 115,120 ****
  651. --- 123,129 ----
  652.         if (++i > rehash) return false;
  653.         ptbl++;
  654.         }
  655. + #endif
  656.   
  657.       PV = SwagHt = ptbl->mv;
  658.       if ((ptbl->depth >= (SHORT) depth) || abs(ptbl->score)>9000)
  659. ***************
  660. *** 138,151 ****
  661.       HashCnt++;
  662.   #endif
  663.   
  664. - #ifdef NEWAGE
  665. -         /* Find entry within rehash window or return failure */
  666. -          for (i=rehash, ptbl = &ttable[side][hashkey % ttblsize];
  667. -                   ptbl->hashbd != hashbd; ptbl++)
  668. -           if (--i == 0) return false;
  669. -         /* Update age of rediscovered node */
  670. -           ptbl->age = TTage - TTdepthage[ptbl->depth];
  671. - #endif
  672.         if (ptbl->flags & truescore)
  673.       {
  674.         *score = ptbl->score;
  675. --- 147,152 ----
  676. ***************
  677. *** 191,207 ****
  678.   
  679.     {
  680.       register struct hashentry *ptbl;
  681. !     register /*unsigned*/ SHORT i = 0;    /*to match new type of rehash --tpm*/
  682.   
  683.       ptbl = &ttable[side][hashkey % ttblsize];
  684.       while (true)
  685.         {
  686. !         if (ptbl->depth == 0 
  687. ! #ifdef NEWAGE
  688. !             || TTage - ptbl->age > newage
  689. ! #endif
  690. !             ) break;
  691. !         if((ptbl->hashbd) == hashbd)if(ptbl->depth > (UCHAR)depth)return false; else break;
  692.           if (++i > rehash)
  693.             {
  694.   #ifdef HASHSTATS
  695. --- 192,207 ----
  696.   
  697.     {
  698.       register struct hashentry *ptbl;
  699. !     register SHORT i = 0;
  700. ! #ifndef NEWAGE
  701.   
  702.       ptbl = &ttable[side][hashkey % ttblsize];
  703.       while (true)
  704.         {
  705. !         if (ptbl->depth == 0) break;
  706. !         if ((ptbl->hashbd) == hashbd) {
  707. !             if (ptbl->depth > (UCHAR)depth) return false; else break;
  708. !         }
  709.           if (++i > rehash)
  710.             {
  711.   #ifdef HASHSTATS
  712. ***************
  713. *** 213,249 ****
  714.             }
  715.           ptbl++;
  716.         }
  717. ! #ifdef NEWAGE
  718. !     {
  719.           /* Look for match or oldest entry to reuse */
  720. !         int i;
  721. !         SHORT old = 0;
  722. !         struct hashentry * oldest = (struct hashentry *)NULL;
  723. !         for (i=rehash, ptbl = &ttable[side][hashkey % ttblsize];
  724. !                 i > 0 && ptbl->hashbd != hashbd; i--, ptbl++)
  725. !             if ((TTage - ptbl->age) > old)
  726. !               {  
  727.                   old = TTage - ptbl->age;
  728.                   oldest = ptbl;
  729.                 }  
  730. !         if (i == 0)
  731. !           {
  732.               ptbl = oldest; /* reuse oldest entry */
  733. !             if (--TTageClock == 0)
  734. !               {
  735.                   TTageClock = TTageRate;
  736.                   TTage++;        /* Everyone is now just a little older */
  737.                 }
  738. !           }
  739. !         ptbl->age = TTage - TTdepthage[ptbl->depth]; /* Set age of this node */
  740.       }
  741. ! #else
  742. !     TTadd++;
  743. ! #endif
  744.   #ifdef HASHSTATS
  745.       HashAdd++;
  746.   #endif
  747. -     if(ptbl->depth > (UCHAR)depth) return false;
  748.       ptbl->hashbd = hashbd;
  749.       ptbl->depth = (UCHAR) depth;
  750.       ptbl->score = score;
  751. --- 213,257 ----
  752.             }
  753.           ptbl++;
  754.         }
  755. !     TTadd++;
  756. !     if (ptbl->depth > (UCHAR)depth) return false;
  757. ! #else /* NEWAGE */
  758. !     utshort old;
  759. !         struct hashentry *oldest;
  760.           /* Look for match or oldest entry to reuse */
  761. !     /* Note that arithmetic on ages is intentionally modulo 65536 */
  762. !         i = rehash;
  763. !     oldest = ptbl = &ttable[side][hashkey % ttblsize];
  764. !         old = TTage - ptbl->age;
  765. !     while (ptbl->hashbd != hashbd) {
  766. !         if (--i == 0) break;
  767. !         ptbl++;
  768. !         if ((TTage - ptbl->age) > old) {
  769.           old = TTage - ptbl->age;
  770.           oldest = ptbl;
  771.           }
  772. !     }
  773. !         if (i == 0) {
  774.               ptbl = oldest; /* reuse oldest entry */
  775. ! #ifdef HASHSTATS
  776. !         THashCol++;
  777. ! #endif
  778. !             if (--TTageClock == 0) {
  779.                   TTageClock = TTageRate;
  780.                   TTage++;        /* Everyone is now just a little older */
  781.           }
  782. !     } else {
  783. ! /*!!!        if (ptbl->depth > (UCHAR)depth) return false;*/
  784.       }
  785. ! /*!!!*/        if (ptbl->depth > (UCHAR)depth) return false;
  786. !         ptbl->age = TTage - TTdepthage[depth]; /* Set age of this node */
  787. ! #endif /* NEWAGE */
  788.   #ifdef HASHSTATS
  789.       HashAdd++;
  790.   #endif
  791.       ptbl->hashbd = hashbd;
  792.       ptbl->depth = (UCHAR) depth;
  793.       ptbl->score = score;
  794. ***************
  795. *** 290,296 ****
  796.         {
  797.           TTageClock = TTageRate;
  798.           TTage = newage+1; /* Zero entries are pre-expired. */
  799. -         TTageRate = ttblsize/(newage/2); /* Average 1/2 of table will be expired */
  800.           /* zero the age of all ttable entries */
  801.           memset(ttable[white],0,sizeof(struct hashentry)*(unsigned)(ttblsize+rehash));
  802.           memset(ttable[black],0,sizeof(struct hashentry)*(unsigned)(ttblsize+rehash));
  803. --- 298,303 ----
  804. ***************
  805. *** 824,827 ****
  806. --- 831,837 ----
  807.   #endif
  808.             }
  809.     }
  810.   
  811. diff -r -b -c gnuchess-4.0.pl74.orig/src/uxdsp.c gnuchess-4.0.pl74/src/uxdsp.c
  812. *** gnuchess-4.0.pl74.orig/src/uxdsp.c    Tue Nov 22 01:36:44 1994
  813. --- gnuchess-4.0.pl74/src/uxdsp.c    Wed May 03 00:32:42 1995
  814. ***************
  815. *** 37,43 ****
  816. --- 37,45 ----
  817.   #include <sys/param.h>
  818.   #include <sys/types.h>
  819.   #include <sys/file.h>
  820. + #ifndef _amigados
  821.   #include <curses.h>      
  822. + #endif
  823.   
  824.   #ifdef notdef
  825.   #if defined(__STDC__)
  826. ***************
  827. *** 79,84 ****
  828. --- 81,91 ----
  829.     signal (SIGINT, Die);
  830.   #ifndef MSDOS
  831.     signal (SIGQUIT, Die);
  832. + #ifdef _amigados
  833. +   if (atexit((void (*) (void)) endwin))
  834. +   { perror("atexit");
  835. +   }
  836. + #endif
  837.     initscr ();
  838.     crmode ();
  839.   #else
  840.